import Vue from 'vue'
import Router from 'vue-router'

const login=()=>import('@/pages/login')
const register=()=>import('@/pages/register')
const home=()=>import('@/pages/home')
const details=()=>import('@/pages/details')
const usersList=()=>import('@/pages/usersList')


Vue.use(Router)

export default new Router({
  routes: [
    {
      path: '/',
      name: 'home',
      component: home
    },
    {
      path: '/login',
      name: 'login',
      component: login
    },
    {
      path: '/register',
      name: 'register',
      component: register
    },
    {
      path: '/usersList',
      name: 'usersList',
      component: usersList
    },
    {
      path: '/details/:questionId',
      name: 'details',
      component: details
    },
    { 
      path: '*', 
      redirect: '/' 
    }
  ]
})
